
{include file="../application/admin/view/default/header.html" title="登陆" adminData=$adminData /}
<style>

    ol,li{
        list-style: none;
        padding: 0;
        margin: 0;
    }
    .title1{
        font-size: 22px;
        font-weight: 500;
        text-align: center;
        margin-bottom: 30px;
    }
    .label{
        margin-bottom: 10px;
        display: inline-block;
        font-size: 18px;
        width: 20%;
        float: left;
        margin: 0;
        height: 44px;
        line-height: 44px;
    }
    .btn{
        width: 100%;
        height: 50px;
        line-height: 50px;
        font-size: 18px;
        font-weight: 400;
    }
    .input-group{
        margin-bottom: 25px;
    }
    .input-group input{
        width: 80%;
        float: left;
    }

</style>
<div id="main" class="container ">
    <div class="post">
        <div style="width: 45%; margin: 0 auto;padding: 40px 0; " >
            <div class="title1">登陆后台管理</div>
            <div class="content">
                <div class="panel panel-default">
                    <div class="panel-body">
                        <div class="input-group clearfix btn-block">
                            <span class="label default ">用户名：</span>
                            <input type="text" class=" inp title"  name="username" id="username">
                        </div>
                        <div class="input-group clearfix btn-block">
                            <span class="label default ">密码：</span>
                            <input type="password" class=" inp title"  name="password" id="password">
                        </div>
                        <div class="input-group clearfix btn-block"  >
                            <button class="btn btn-primary "   id="submit">登陆</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
</body>

<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script>
    $('#submit').on('click',function(){
        $.ajax({
            type:'POST',
            url:'/admin/index/login',
            dataType:'json',
            data:{'username':$('#username').val(),'password':$('#password').val()},
            success:function(data){
                alert(data.msg);
                if(!data.type){
                    window.location.href='/admin/news/index';
                }
            }
        });
    });
</script>

</html>

